function [Woce_sec,stnnbr,stn_num,cast_num,day_stn,h_stn,date_dec,lon_stn_bot,lat_stn_bot,prof_bot,nit,stn_num_bot]=WOCE_bottle(campagne,dirWOCE)
%campagne=2;
% ---------------------------------------------------------
% Programme permettant de tracer les sections WOCE � partir
% des donnees de Bouteilles.
%
% Lecture et Trace
%
% (G. Charria)
% --------------------------------------------------------
%close all

% ---- Schema 1: racine+numstn+extension
switch campagne
 case 2
  schema = 1;  
  racine='KB51D';
  extension='.WCT';
  cruise='a22';
  istat=1;
  icast=istat+1;
  iprof=6;
  init=14;
  units='{\mu}mol/kg';
  
 case 4
  schema = 1;  
  racine='A25ctd';
  extension='';
  cruise='a25'; 
  istat=1;
  icast=istat+1;
  iprof=6;
  init=14;
  units='umol/kg';
  
 case 6
  schema = 1;
  racine='ETA2';
  extension='A.CTD';
  cruise='ar04_f';
  istat=1;
  icast=istat+1;
  iprof=6;
  init=14;
  units='umol/kg';
  
  % ---- Sch�ma 2: racine+stn+char+castnbr(3I)+extension
 case 5
  schema = 2;
  racine='M';
  extension='.CTD';
  cruise='a02b';
  racine2='C';  
  istat=1;
  icast=istat+1;
  iprof=5;
  init=11;
  units='{\mu}mol/L';
     
  % ---- Sch�ma 3: racine+stn+char+castnbr(2I)+extension
 case 3
  schema = 3;
  racine='';
  racine2='';
  extension='.CTD';
  cruise='a24';
  istat=1;
  icast=istat+1;
  iprof=6;
  init=14;
  units='umol/kg';
  
  
  % ---- Sch�ma 4: racine+stn+char+castnbr(1I)+extension
  case 7
   schema = 4;
   racine='B396';
   extension='.CTD';
   cruise='ar12_e';
   racine2='';
   istat=1;
   icast=istat+1;
   iprof=5;
   init=13;
   units='umol/Kg';
   
   % ---- Sch�ma 5: racine+stn(I2)+char+castnbr(I1)+extension
  
   % ---- Sch�ma 6: racine+stn(3I)+extension
  
  
 otherwise
  disp('Unknown Cruise !')
end


fichier_su=[dirWOCE,'/isDATA/',cruise,'/',cruise,'su.txt'];
fichier_track=[dirWOCE,'/isDATA/',cruise,'/',cruise,'trk2.jpg'];
fichier_bot=[dirWOCE,'/isDATA/',cruise,'/',cruise,'hy.txt'];


[Woce_sec,stnnbr,stn_num,cast_num,day_stn,h_stn,date_dec,lon_stn,lat_stn] = read_CTD_su(fichier_su);


% ---- Initialisation des variables
stn_num_bot(1:5000)=NaN;
cast_num_bot(1:5000)=NaN;
nit(1:5000)=NaN;
prof_bot(1:5000)=NaN;


% ---- Lecture des donnees.
dat=textread(fichier_bot,'%s','delimiter','\n','whitespace','');

% ---- Transformation cell to char
dat_char=char(dat);


stn_compt=0;

% ---- Extraction des variables de la cha�ne de caratere dat_char
for ilign=5:(size(dat_char,1)-1)

  % Remplace les espaces par ;
  find_space=regexprep(dat_char(ilign,:),'\s',';');
  % Trouve les positions des variables dans la cha�ne de caract�re
  num_deb=1;
  num_fin=1;
  debut(1:21)=0;
  debut(1)=1;
  fin(1:21)=0;
  for i=1:(size(find_space,2)-1)
    % Position de debut
    if (strcmp(find_space(i),';') == 1) & (strcmp(find_space(i+1),';') == 0) 
      debut(num_deb)=i+1;
      num_deb=num_deb+1;
    end
    % Position de fin
    if (strcmp(find_space(i),';') == 0) & (strcmp(find_space(i+1),';') == 1) 
      fin(num_fin)=i;   
      num_fin=num_fin+1;
    end
  end

  % On prend les positions de fin de station.  

  % Num�ro de colonne des variables.
  

  
 
  stn_compt=stn_compt+1;
  % Numero de station
%  find_space(debut(istat):fin(istat))
  stn_num_bot(stn_compt)=str2num(find_space(debut(istat):fin(istat)));
  
  
  
  % Numero de Cast
%  find_space(debut(icast):fin(icast))
  cast_num_bot(stn_compt)=str2num(find_space(debut(icast):fin(icast)));
  
  % Profondeur
  prof_bot(stn_compt)=str2num(find_space(debut(iprof):fin(iprof)));
  
  
  % Nitrates
  nit(stn_compt)=str2num(find_space(debut(init):fin(init)));
    
  
end


% Suppression des valeurs n�gatives = pas de mesure
index_neg=find(nit < 0);
nit(index_neg)=NaN;



%whos

% Pour chaque stn_num_bot -> stn_num -> lon_stn -> lon_stn_bot
lon_stn_bot(1:5000)=NaN;
lat_stn_bot(1:5000)=NaN;
for ii=1:size(stn_num_bot,2)
  if(isnan(stn_num_bot(ii))==0)
    index_stn=find(stn_num==stn_num_bot(ii) & cast_num==cast_num_bot(ii));
    if (isempty(index_stn)==0)
      lon_stn_bot(ii)=lon_stn(index_stn(1));
      lat_stn_bot(ii)=lat_stn(index_stn(1));
    end
  end
end



